package com.qf.listener;

import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * 监听RabbitMQ的服务端
 *
 * @author lixu
 */
//@Component //实例化
//@RabbitListener(queues = {"queue1","queue2"})
//@RabbitListener(queues = {"queue1"}) //类头上
public class RabbitConfigListener2 {

    /**
     * 接收监听到的消息  信道
     */
   // @RabbitHandler  //方法
    public void receiverMessage(String msg,Message message) {
        System.out.println("接收消息对象：再获取消息体:" + new String(message.getBody()));
    }


}
